home *** CD-ROM | disk | FTP | other *** search
/ Your Choice 3 / Your Choice Software Collection 3.iso / prgmming / swag05 / color.swg < prev    next >
Encoding:
Text File  |  1994-09-22  |  4.4 KB  |  1 lines

  1. SWAGOLX.EXE (c) 1993 GDSOFT  ALL RIGHTS RESERVED 00002                                                                           1      05-25-9408:01ALL                      STEVEN DEBRUYN           Change Colors            SWAG9405            13     ^╫   πPROGRAM Change_Color;πUSES Crt;πVAR Tel, Tel2 : Byte;ππ(**********************************************************************)π(*   Copyright for this procedure by Steven Debruyn 1994              *)π(*   Hereby donated to Public Domain                                  *)π(*   Feel free to put this in the SWAG if you think it's any good     *)π(**********************************************************************)πPROCEDURE Say(Zin : String);πVAR Kleur : Byte;π     Code : Integer;π     Zin1 : String;π     Zin2 : String;π  TempZin : String;π   Gedaan : Boolean;πBEGINπ  WHILE Pos('\\',Zin) <> 0 DO BEGINπ    Zin1 := Copy(Zin, Pos('\\',Zin)+2, Pos('\\',Zin)+Pos(' ',Zin)-4);π    Val(Zin1,Kleur,Code);π    TextAttr:= Kleur;π    Zin2 := Copy(Zin, Pos('\\',Zin)+Length(Zin1)+2,Length(Zin));π    TempZin := Copy(Zin2, Pos(' ',Zin2), Pos('\\',Zin2)-1);π    Write(TempZin);π    Zin := Copy(Zin2, Pos(TempZin,Zin2)+Length(TempZin), Length(Zin2));π  END;π  WriteLn;πEND;ππBEGINπ  TextAttr:=0;π  ClrScr;π  Say('\\5 Hello\\9 World out there,\\79 this is a test\\154 !\\');π  Say('\\14 I can change color\\23 and \\220 background.\\138 and'+π      ' BLINK at the same time.\\');π  Say('\\15 Press\\11 [\\14 ENTER\\11 ]\\');π  ReadLn;π  ClrScr;π  Tel2:=1;π  FOR Tel := 1 TO 255 DOπ  BEGINπ    TextAttr := Tel;π    WriteLn('This is Color : ',Tel);π    Inc(Tel2);π    IF Tel2 = 24 THENπ    BEGINπ      ReadLn;π      TextAttr:=0;π      ClrScr;π      Tel2 := 1;π    END;π  ENDπEND.π                                                               2      05-26-9406:18ALL                      MICHAEL HOENIE           Color Codes              SWAG9405            21     ^╫   {π ├─>I would like to implement color codes into my on-line doors.  You knowπ ├─>the type that Wildcat or PCB have.  The @ codes.  Does anyone have aπ ├─>routine that would (I assume) read in a file bite by bite and when itπ ├─>comes across the @ char it would read the next 3 bits and determine whatπ ├─>action to take?ππHi Larry! Sure do have one for 'ya!ππTry this one out for size. It can be optimized to be smaller, but as anπexample, this one works for sure! You'll have to incorporate it into yourπcode to dump out to the modem (no problem I hope!)ππGive this a try: }ππ  typeπ    string255=string[255];ππ  procedure outgoing(stream:string255; ret:integer);π  varπ    _retval:integer;π    out,out1:string[5];π  beginπ    for _retval:=1 to length(stream) doπ      beginπ        out:=copy(stream,_retval,1);π        case out[1] ofπ          '@':begin { COLOR CODE    ---> @X1F or other }π                out1:=copy(stream,_retval+2,1);π                case out1[1] ofπ                  '0':textbackground(0);π                  '1':textbackground(1);π                  '2':textbackground(2);π                  '3':textbackground(3);π                  '4':textbackground(4);π                  '5':textbackground(5);π                  '6':textbackground(6);π                  '7':textbackground(7);π                  '8':textbackground(8);π                  '9':textbackground(9);π                  'A':textbackground(10);π                  'B':textbackground(11);π                  'C':textbackground(12);π                  'D':textbackground(13);π                  'E':textbackground(14);π                  'F':textbackground(15);π                end;π                out1:=copy(stream,_retval+3,1);π                case out1[1] ofπ                  '0':textcolor(0);π                  '1':textcolor(1);π                  '2':textcolor(2);π                  '3':textcolor(3);π                  '4':textcolor(4);π                  '5':textcolor(5);π                  '6':textcolor(6);π                  '7':textcolor(7);π                  '8':textcolor(8);π                  '9':textcolor(9);π                  'A':textcolor(10);π                  'B':textcolor(11);π                  'C':textcolor(12);π                  'D':textcolor(13);π                  'E':textcolor(14);π                  'F':textcolor(15);π                end;π                _retval:=_retval+3;π              end;π          else write(out[1]);π        end;π      end;π    if ret=2 then writeln;π  end;ππ